/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.route.system.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author neco
 */
@Entity
@Table(name = "rps_route_time_schedule",  schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RpsRouteTimeSchedule.findAll", query = "SELECT r FROM RpsRouteTimeSchedule r"),
    @NamedQuery(name = "RpsRouteTimeSchedule.findByScheduleId", query = "SELECT r FROM RpsRouteTimeSchedule r WHERE r.scheduleId = :scheduleId"),
    @NamedQuery(name = "RpsRouteTimeSchedule.findByScheduleTime", query = "SELECT r FROM RpsRouteTimeSchedule r WHERE r.scheduleTime = :scheduleTime"),
    @NamedQuery(name = "RpsRouteTimeSchedule.findByScheduleWeekDayAndScheduleDesc", query = "SELECT r FROM RpsRouteTimeSchedule r WHERE r.scheduleWeekDay = :scheduleWeekDay AND r.scheduleRouteDescription.descriptionId = :descriptionId"),
    @NamedQuery(name = "RpsRouteTimeSchedule.findByScheduleWeekDay", query = "SELECT r FROM RpsRouteTimeSchedule r WHERE r.scheduleWeekDay = :scheduleWeekDay")})
public class RpsRouteTimeSchedule implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "schedule_id", nullable = false)
    private Integer scheduleId;
    @Column(name = "schedule_time")
    @Temporal(TemporalType.TIME)
    private Date scheduleTime;
    @Column(name = "schedule_week_day")
    private Integer scheduleWeekDay;
    @JoinColumn(name = "schedule_route_description", referencedColumnName = "description_id")
    @ManyToOne
    private RpsRouteDescription scheduleRouteDescription;

    public RpsRouteTimeSchedule() {
    }

    public RpsRouteTimeSchedule(Integer scheduleId) {
        this.scheduleId = scheduleId;
    }

    public Integer getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(Integer scheduleId) {
        this.scheduleId = scheduleId;
    }

    public Date getScheduleTime() {
        return scheduleTime;
    }

    public void setScheduleTime(Date scheduleTime) {
        this.scheduleTime = scheduleTime;
    }

    public Integer getScheduleWeekDay() {
        return scheduleWeekDay;
    }

    public void setScheduleWeekDay(Integer scheduleWeekDay) {
        this.scheduleWeekDay = scheduleWeekDay;
    }

    public RpsRouteDescription getScheduleRouteDescription() {
        return scheduleRouteDescription;
    }

    public void setScheduleRouteDescription(RpsRouteDescription scheduleRouteDescription) {
        this.scheduleRouteDescription = scheduleRouteDescription;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scheduleId != null ? scheduleId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RpsRouteTimeSchedule)) {
            return false;
        }
        RpsRouteTimeSchedule other = (RpsRouteTimeSchedule) object;
        if ((this.scheduleId == null && other.scheduleId != null) || (this.scheduleId != null && !this.scheduleId.equals(other.scheduleId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.route.system.entity.RpsRouteTimeSchedule[ scheduleId=" + scheduleId + " ]";
    }
    
}
